/*************************************************
 Copyright © DusunIoT 2005-2023. All rights reserved.
 File name: common_types.h
 Author: yaoyuxi
 Version: V1.0
 Date: Tuesday, July 11, 2023 
 Description: 变量类型统一定义
 Others: none
 History: Created July 11, 2023  by:yaoyuxi
*************************************************/

#ifndef __COMMON_TYPES_H__
#define __COMMON_TYPES_H__

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef char                      RB_INT8;
typedef unsigned char             RB_UINT8;
typedef short                     RB_INT16;
typedef unsigned short            RB_UINT16;
typedef int                       RB_INT32;
typedef unsigned int              RB_UINT32;
typedef long                      RB_LONG;
typedef unsigned long             RB_ULONG;
typedef unsigned long long        RB_UINT64;
typedef long long                 RB_INT64;


typedef float                     RB_FLOAT;
typedef double                    RB_DOUBLE;
typedef void                      RB_VOID;
typedef void*                     RB_PROC;

#ifndef RB_BOOL
#define RB_BOOL                  RB_INT32
#endif

#ifndef RB_TRUE
#define RB_TRUE                  1
#endif

#ifndef RB_FALSE
#define RB_FALSE                 0
#endif

#ifndef RB_OK
#define RB_OK                   0
#endif

#ifndef RB_ERR
#define RB_ERR                  -1
#endif

#ifndef RB_NULL
#define RB_NULL                 NULL
#endif
    
#ifndef RB_FILE
#define RB_FILE                 FILE
#endif

#define RB_ASSERT(x) do { if (!(x)) exit(0); } while (0)

#define MIN(i, j) (((i) < (j)) ? (i) : (j))
#define MAX(i, j) (((i) > (j)) ? (i) : (j))

#ifdef __cplusplus
}
#endif

#endif  //__COMMON_TYPES_H__
